#include "hiding.h"


int main(int argc, char *argv[]) {

    if(argc != 4) {
        printf("specify the image file, output file and cipher rate...\n");
        exit(0);
    }

    srand(time(NULL));

    FILE *image = fopen(argv[1], "rb");

    if(image == NULL) { printf("file error\n"); exit(0); }

    UCHAR header[1078], raw[DEGREE][DEGREE] = {0};

    readHeader(image, header); readImage(image, raw);

    randomCipherWrite(raw, atoi(argv[3]));

    FILE *carry = fopen(argv[2], "wb");

    if(carry == NULL) { printf("file error\n"); exit(0); }

    writeImage(carry, header, raw);


    fclose(carry);
    fclose(image);

    return 0;
}